package com.parktech.sun.domain.model.sms;

import com.parktech.sun.domain.model.system.User;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
import org.springframework.orm.hibernate3.support.ClobStringType;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * User: Think
 * Date: 2010-12-20
 * Time: 1:54:51
 */

@Entity
@TypeDefs(@TypeDef(name="clob",typeClass=ClobStringType.class))
public class SmsTemplate implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @Column(length = 66, nullable = false)
    private String name;

    @Lob
    @Type(type="clob")
    @Column(nullable = false)
    private String content;

    @Column(nullable = false)
    private Date createDatetime = new Date();

    @Column(nullable = false)
    private Date updateDatetime = new Date();

    @ManyToOne
    @JoinColumn(name = "creator_id")
    private User creator;

    @ManyToOne
    @JoinColumn(name = "modifier_id")
    private User modifier;

    private String description;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateDatetime() {
        return createDatetime;
    }

    public void setCreateDatetime(Date createDatetime) {
        this.createDatetime = createDatetime;
    }

    public Date getUpdateDatetime() {
        return updateDatetime;
    }

    public void setUpdateDatetime(Date updateDatetime) {
        this.updateDatetime = updateDatetime;
    }

    public User getCreator() {
        return creator;
    }

    public void setCreator(User creator) {
        this.creator = creator;
    }

    public User getModifier() {
        return modifier;
    }

    public void setModifier(User modifier) {
        this.modifier = modifier;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}

